package com.example.glidelearningproject.fragment.option;

import android.os.Bundle;

import com.xuexiang.xpage.annotation.Page;
import com.xuexiang.xpage.base.XPageSimpleListFragment;

import java.util.List;

@Page(name = "Glide选项示例")
public class RequestOptionsUseFragment extends XPageSimpleListFragment {
    public static final String OPTION_KEY = "optionKey";
    @Override
    protected List<String> initSimpleData(List<String> lists) {
        lists.add("centerCrop");
        lists.add("RequestOptions");
        lists.add("过度选项");
        lists.add("缩略图 (Thumbnail) 请求");
        lists.add("RequestBuilder");
        lists.add("在失败时开始新的请求");
        lists.add("组件选项");
        return lists;
    }

    @Override
    protected void onItemClick(int position) {
        Bundle bundle = new Bundle();
        switch (position) {
            case 0:
                bundle.putInt(OPTION_KEY,0);
                break;
            case 1:
                bundle.putInt(OPTION_KEY,1);
                break;
            case 2:
                bundle.putInt(OPTION_KEY,2);
                break;
            case 3:
                bundle.putInt(OPTION_KEY,3);
                break;
            case 4:
                bundle.putInt(OPTION_KEY,4);
                break;
            case 5:
                bundle.putInt(OPTION_KEY,5);
                break;
            case 6:
                bundle.putInt(OPTION_KEY,6);
                break;
        }
        openPage(GlideOptionsFragment.class,bundle);
    }
}
